#!/bin/bash
cd /home/oracle/backup
filedmp="interlib`date +%d`.dmp"
filelog="interlib`date +%d`.log"

su - oracle -c "sqlplus / as sysdba << EOF
drop user interlib cascade;
create user interlib identified by cslginterlib default tablespace interlib;
grant dba to interlib;
commit;
quit
EOF
"
sleep 5

su - oracle -c "imp \'sys/sys as sysdba\'  file=/home/oracle/backup/$filedmp log=/home/oracle/backup/$filelog full=y"
exit 0
